Tagged: Property Wrapper

There are 9 items tagged #Property Wrapper.
And there a lots of other tags to explore.

How to initialize @Binding in SwiftUI

Learn how to implement a custom init that accepts a @Binding variable.

Should we manually call @StateObject initializer

Is it OK to manually initialize @StateObject? Let's find out.

@State variable initialization in SwiftUI

Learn how to initialize a state variable and discuss whether you should do it or not.

How to scale margin and padding with @ScaledMetric Property Wrapper

Dynamic Type automatically scales a font size according to Accessibility settings. In iOS 14, we also have a way to scale numeric values like padding and margin.

What is a Property Wrapper in Swift

As the name implies, a property wrapper is a new type that wraps a property to add additional logic. Let's see what it capable of and the benefit it provided.

How to initialize @StateObject with parameters in SwiftUI

@StateObject is an essential property wrapper in SwiftUI, but I found the way to initialize them is not obvious.

Data in SwiftUI, Part 3: Tools

The last part in a series on understanding data in SwiftUI. See all tools SwiftUI provided to declare different types of data and dependency. Learn when and how to use @State, @Binding, ObservableObject, @ObservedObject, @EnvironmentObject, and @Environment.

Data in SwiftUI, Part 2: Views as a function of data

Part 2 in a series on understanding data in SwiftUI. We will talk about the key that makes principles in part 1 possible in SwiftUI. And how this resulting in a reduction of the complexity of UI development.

Data in SwiftUI, Part 1: Data

Part 1 in a series on understanding data in SwiftUI. In the first part, we will try to understand the importance of data and how they play an essential role in SwiftUI.

See all tags.